home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue29 / web / FSTATE1.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1997-07-08  |  1.3 KB  |  47 lines

  1. unit fstate1;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Classes, HTTPApp;
  7.  
  8. type
  9.   TWebModule1 = class(TWebModule)
  10.     PageProducer1: TPageProducer;
  11.     procedure PageProducer1HTMLTag(Sender: TObject; Tag: TTag;
  12.       const TagString: String; TagParams: TStrings;
  13.       var ReplaceText: String);
  14.     procedure WebModule1WebActionItem1Action(Sender: TObject;
  15.       Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);
  16.   private
  17.     { Private declarations }
  18.   public
  19.     { Public declarations }
  20.   end;
  21.  
  22. var
  23.   WebModule1: TWebModule1;  
  24.  
  25. implementation
  26.  
  27. {$R *.DFM}
  28.  
  29. procedure TWebModule1.PageProducer1HTMLTag(Sender: TObject; Tag: TTag;
  30.   const TagString: String; TagParams: TStrings; var ReplaceText: String);
  31. begin
  32.   with (Sender as TPageProducer).Dispatcher do
  33.     if CompareText(TagString, 'encfullname') = 0 then
  34.       ReplaceText := HTTPEncode(Request.QueryFields.Values['fullname'])
  35.     else
  36.       if CompareText(TagString, 'fullname') = 0 then
  37.         ReplaceText := Request.QueryFields.Values['fullname'];
  38. end;
  39.  
  40. procedure TWebModule1.WebModule1WebActionItem1Action(Sender: TObject;
  41.   Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);
  42. begin
  43.   Response.Content := PageProducer1.Content;
  44. end;
  45.  
  46. end.
  47.